package com.guangfeng.yql.comm.util;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

public class ModuleUtils {
    private static Map<String, String> map = new ConcurrentHashMap<>();

    static {
        map.put("bean", "yql-mail-bean");
        map.put("controller", "yql-mail-controller");
        map.put("mysql", "yql-mail-mysql");
        map.put("serve", "yql-mail-serve");
        map.put("service", "yql-mail-serve");
        map.put("impl", "yql-mail-serve");
        map.put("redis", "yql-mail-redis");
    }

    public static String getModuleName(String page) {
        return map.get(page);
    }

    public static String getModuleNameParserPage(String page) {
        String[] split = page.split("\\\\");
        return getModuleName(split[split.length - 1]);
    }

}
